﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BomComparison.Core.Model;

// 位号维度的变更类型
public enum PartReferenceChangeType
{
    Added,      // 新增
    Deleted,    // 删除
    Replaced    // 修改（相同位号，不同料号）
}

public class ComparisonResultByPartReference
{

    public PartReferenceChangeType ChangeType { get; set; } // 添加 PartNumberChangeType 属性

    public string PartReference { get; set; } = string.Empty;
    public BomItem OldBomItem { get; set; }
    public BomItem NewBomItem { get; set; }


    public ComparisonResultByPartReference()
    {
    }

    // Private constructor to enforce using the builder
    public ComparisonResultByPartReference(BomItem oldItem, BomItem newItem, PartReferenceChangeType changeType)
    {
        OldBomItem = oldItem;
        NewBomItem = newItem;
        ChangeType = changeType; // 设置 PartNumberChangeType
    }
}
